<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreatePicAlbumPicsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::dropIfExists('pic_album_pics');
		Schema::create('pic_album_pics', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('pic_album_id')->unsigned()->index('tag_content_tag_id_index')->comment('图集ID');
			$table->integer('vposteri_id')->unsigned()->comment('图片ID');
			$table->timestamps();
			$table->softDeletes();
			$table->unique(['pic_album_id','vposteri_id'], 'tag_id');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('pic_album_pics');
	}

}
